import request from '@/utils/request'

// 查询租约保理申请列表
export function listFactoring(query) {
  return request({
    url: '/financial/factoring/list',
    method: 'get',
    params: query
  })
}

//产品列表
export function productTypeList(query) {
  return request({
    url: '/financial/product/getLeaseList',
    method: 'get',
    params: query
  })
}

//合同
export function contractList(query) {
  return request({
    url: '/financial/contract/getCfContractListByName',
    method: 'get',
    params: query
  })
}

// 查询租约保理申请详细
export function getFactoring(id) {
  return request({
    url: '/financial/factoring/' + id,
    method: 'get'
  })
}

// 新增租约保理申请
export function saveJrFactoring(query) {
  return request({
    url: '/financial/factoring',
    method: 'post',
    data: query
  })
}

// 修改租约保理申请
export function updateFactoring(data) {
  return request({
    url: '/financial/factoring',
    method: 'put',
    data: data
  })
}

// 删除租约保理申请
export function delFactoring(id) {
  return request({
    url: '/financial/factoring/' + id,
    method: 'delete'
  })
}

//根据合同和保理产品计算该合同的保理申请明细
export function factoringApply(contractId,productId,interestRate,serviceFee,row){
  return request({
    url:'/financial/factoring/getFactoringDatil',
    method:'post',
    data:{contractId:contractId,productId:productId,interestRate:interestRate,serviceFee:serviceFee,row:row}
  })
}

// //申请租约保理
// export function saveJrFactoring(query){
//   return request({
//     url:'/banking/jr-factoring/saveJrFactoring',
//     method:'post',
//     data:query
//   })
// }
